<template>
	<!-- 确认收货成功 -->
	<view class="page">
		<status-bar :title="btnType == 1 ? '评价成功' : '交易成功'"></status-bar>
		<view class="flex-box flex-center topTXT align-center">
			<text class="iconfont icon-success"></text>
			<text class="txt">{{ btnType == 1 ? '评价成功' : '交易成功' }}</text>
		</view>
		<view class="flex-box flex-center">
			<view class="btn" @click="backHome">返回首页</view>
			<view class="btn" @click="toUrl('/pages/index/orderList')" v-if="btnType == 1">查看订单</view>
			<view class="btn" @click="toUrl('/commentPage/comment/commentGoods?oid='+order_id)" v-else>立即评价</view>
		</view>
		<view class="youLike" v-if='likeList'>
			<view class="flex-box flex-center align-center youTitle">
				<text class="toLeft" :style="{'--color': color,'--color_aid': color_aid}"></text>
				<text class="toLeft" :style="{'--color': color,'--color_aid': color_aid}"></text>
				<view>猜你喜欢</view>
				<text class="toRight" :style="{'--color': color,'--color_aid': color_aid}"></text>
				<text class="toRight" :style="{'--color': color,'--color_aid': color_aid}"></text>
			</view>
			<GoodsList hot='0' type='1' :goodsData='likeList'></GoodsList>
		</view>
	</view>
</template>

<script>
	import GoodsList from "../../components/goodsList.vue"
	export default {
		components:{GoodsList},
		data() {
			return {
				order_id:'',
				color: getApp().globalData.color,
				color_aid: getApp().globalData.color_aid,
				likeList: '',
				btnType: 0 // 确认收货 0、评价 1
			};
		},
		onLoad(e) {
			if(e.oid){
				this.order_id = e.oid
			}
			if(e.btnType){
				this.btnType = e.btnType
			}
			this.$http.post({
				url: '/singleSaleApi/guessLikeGoods',
				data: {
					bid: uni.getStorageSync("bid")
				}
			}).then(res => {
				if (res.data) {
					this.likeList = res.data;
				}
			}) 
		}
	}
</script>

<style lang="scss" scoped>
	.topTXT{
		padding: 40rpx;
		.txt{
			font-size: 44rpx;
			font-weight: bold;
			color: #333;
		}
		.icon-success{
			font-size: 50rpx;
			margin-right: 10rpx;
			color: $uni-color-success;
		}
	}
	.btn{
		line-height: 66rpx;
		width: 200rpx;
		color: #333333;
		font-size: 26rpx;
		text-align: center;
		margin: 30rpx 30rpx 80rpx;
		border-radius: 66rpx;
		border: 1px solid  #D8D8D8;
	}
</style>
